#include"prosserBar.h"

typedef void (*callback)(int);///函数指针类型
void download(callback cb)
{
  int total=1000;
  int curr=0;
  //下载进度
  while(curr<=total)
  {
    usleep(50000);
    int rate=curr*100/total;//更新进度
    cb(rate);
    curr+=10;//模拟循环下载进度
  }
  printf("\n");
} 
int main()
{ 
  printf("download1 :\n");
  download(prosserbar);
  initdown();
  printf("download2 :\n");
  download(prosserbar);
  initdown();
  printf("download3 :\n");
  download(prosserbar);
  initdown();
  printf("download4 :\n");
  download(prosserbar);
  initdown();

  return 0 ;
}
